from __future__ import print_function
import logging
import sys
import os
from os.path import join as joinpath, isdir

import odoo
from odoo.modules import get_modules, get_module_path

commands = {}

class CommandType(type):
    def __init__(cls, name, bases, attrs):
        super(CommandType, cls).__init__(name, bases, attrs)
        name = getattr(cls, name, cls.__name__.lower())
        cls.name = name
        if name != 'command':
            commands[name] = cls

Command = CommandType('Command', (object,), {'run': lambda self, args: None})

class Help(Command):
    """Display the list of available commands"""
    def run(self, args):
        pass

def main():
    args = sys.argv[1:]
    if len(args) > 1 and args[0].startswith('--addons-path=') and not args[1].startswith("-"):
        pass

    command = "server"

    if len(args) and not args[0].startswith("-"):
        pass

    if command in commands:
        o = commands[command]()
        o.run(args)
    else:
        pass


